package org.example.m6;

import jdk.jfr.DataAmount;

import java.util.Date;
public class Person {
    private String name; // 姓名
    private String gender; // 性别
    private Date birthDate; // 出生日期
    private String nationality; // 国籍

    // 构造方法
    public Person(String name, String gender, Date birthDate, String nationality) {
        this.name = name;
        this.gender = gender;
        this.birthDate = birthDate;
        this.nationality = nationality;
    }

    // 获取和设置方法
    public String getName() { return name; }
    public void setName(String name) { this.name = name; }

    public String getGender() { return gender; }
    public void setGender(String gender) { this.gender = gender; }

    public Date getBirthDate() { return birthDate; }
    public void setBirthDate(Date birthDate) { this.birthDate = birthDate; }

    public String getNationality() { return nationality; }
    public void setNationality(String nationality) { this.nationality = nationality; }

    // 展示成员属性的方法
    public void showInfo() {
        System.out.println("个人信息:");
        System.out.println("姓名: " + name);
        System.out.println("性别: " + gender);
        System.out.println("出生日期: " + birthDate);
        System.out.println("国籍: " + nationality);
    }
}
